local skynet = require "skynet"
local mysql = require "skynet.db.mysql"

local s = require "service"
local table_utils = require "table_utils"


s.resp.update_exp = function(source, id, data)
    local timestamps = os.time()
    local sql = string.format("update users set exp=%d where uid=%d", data.coin or 0, id)
    skynet.error("update_exp query sql:", sql)

    local res = s.db:query(sql)

    if res.err then
        skynet.error("update_exp error:", res.err)
        return false
    else
        return true
    end
end
